//
//  TextGridConfig.swift
//  AmountBody
//
//  Created by Qiu Jishuai on 2018/2/1.
//  Copyright © 2018年 RCMTM. All rights reserved.
//

import Foundation

class JSFromCellItemConfig: NSObject {
    var text: String?
    /// 默认为systemFont 12
    var font: UIFont?
    /// 默认为 themeDarkGrayColor
    var textColor: UIColor?

    /// 设置了该属性之后,则 text  font textColor 等属性均无效
    var attributeText: NSAttributedString?

    /// 如果为0 则按照数量平均分配width
    var scale: CGFloat = 0

    var alignment: NSTextAlignment = .center

    var insets: UIEdgeInsets = .zero

    //无需设置该属性
//    var frame: CGRect = .zero

    init(text: String?,
         font: UIFont? = nil,
         textColor: UIColor? = nil,
         scale: CGFloat = 0,
         alignment: NSTextAlignment = .center,
         insets: UIEdgeInsets = .zero) {
        self.text = text
        self.font = font
        self.textColor = textColor
        self.scale = scale
        self.alignment = alignment
        self.insets = insets
        super.init()
    }

    init(attributeText: NSAttributedString?,
         scale: CGFloat = 0,
         alignment: NSTextAlignment = .center,
         insets: UIEdgeInsets = .zero) {
        self.attributeText = attributeText
        self.scale = scale
        self.alignment = alignment
        self.insets = insets
        super.init()
    }
}
